#include<cstdio>

bool check(int number) {
// 检测是否为回文数
    int k = number / 1000;
    int h = number % 1000 / 100;
    int t = number % 100 / 10;
    int n = number % 10;
    if (k == n && h == t)
        return true;
    else
        return false;
}

int main() {
    int a;
    scanf("%d", &a);
    if(check(a)) 
        printf("YES");
    else
        printf("NO");
    return 0;
}